#!/bin/bash
kill_process(){
pid=`ps -ef | grep $1 |grep -v "grep" | awk '{print $2}'`
 if [ -n "$pid"  ];then
  echo will kill $pid
  kill -9 $pid
 else
  echo "already killed~"
 fi
}

kill_process $1